<%--
 *  File:    ZylStdareaSelect.jsp
 *  @Author: Jackwang 
 *  Date:    2013/2/21
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.ZylStdareaSelect");  
  String strModuleName = "OGM";
  String strTableName = "ovzylstdarea";
  String contextPath = request.getContextPath();
%>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title>ZylStdareaSelect</title>
<PageFlow:CheckPageFlow pageName="zylstdareaselect"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/FuncLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<%
  Vector zylstdareas = (Vector)pageContext.getAttribute("allzylstdarea");
  if(zylstdareas == null)
  {
	  zylstdareas = new Vector();
  }
  cat.debug("The zylstdarea is :" + zylstdareas);          
%>
<script>
function clickRegion(code,name,id)
{
  document.regionselectform.areacode.value = code;
  document.regionselectform.areaname.value = name;
  document.regionselectform.areaid.value = id;
  
}

function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(regionselectform,actionvalue,orderbyname);
  editform.action = "ZylStdareaSelect.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();  
}

function setParentValue()
{
  if(document.regionselectform.areacode.value != null && document.regionselectform.areacode.value != -1)
    opener.setAreas(document.regionselectform.areaid.value,document.regionselectform.areaname.value,document.regionselectform.areacode.value);
  
  window.close();
}

</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" cellspacing="0" cellpadding="0" height="100%">
<form name="regionselectform" method="post">
    <input type="hidden" name="pagename" value="zylstdareaselect">
    <input type="hidden" name="actionname"> 
    <input type="hidden" name="vtablename">  
    <input type="hidden" name="languagecode" value="<%=JspHelper.filterNull( session.getAttribute("languagecode") )%>">
    <tr> 
      <td valign="top"> 
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="summary_top"></td>
          </tr>
        </table>
       
        
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
          <tr> 
    <tr> 
      <td width="5%" class="deepblue-left">&nbsp;</td>
      <td class="deepblue-left" width="60" nowrap>&nbsp;<a href="javascript:page_summary('orderby','areacode')"><%= label.getLabelName("L_AreaCode") %></a></td>
      <td class="deepblue-left">&nbsp;<a href="javascript:page_summary('orderby','areaname')"><%= label.getLabelName("L_AreaName") %></a></td>
    </tr>
     <%
        int i = 0;
        String strIsChecked = new String("Checked");
        String strClassType = new String();   
        String strZylstdareaCode = "";     
        String strZylstdareaName = "";
        String nZylstdareaid = "";
     %>
     <logic:iterate id="zylstdarea" collection="<%= zylstdareas %>">                      
     <%
       HashMap zylstdareaMap = (HashMap)pageContext.getAttribute("zylstdarea"); 
       if(i%2 == 1)
       {
         strClassType = "td-listrom";
       }else{                    
         strClassType = "";
       }
       if(i != 0)
       {          
         strIsChecked = "";
       }
       else
       {
         strZylstdareaCode = (String)(zylstdareaMap.get("areacode"));         
         strZylstdareaName = (String)(zylstdareaMap.get("areaname"));
         nZylstdareaid = (String)(zylstdareaMap.get("areaid"));
       }  
       i++;        
     %>       
     <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'"  onClick="javascript:radiotrue('areaid<%=JspHelper.filterNull( i )%>');clickRegion('<%=JspHelper.filterNull( zylstdareaMap.get("areacode") )%>','<%=JspHelper.filterNull( zylstdareaMap.get("areaname") )%>','<%=JspHelper.filterNull( zylstdareaMap.get("areaid") )%>');" class="<%=JspHelper.filterNull( strClassType )%>">
      <td class="<%=JspHelper.filterNull( strClassType )%>"> 
        <input id=areaid<%=JspHelper.filterNull( i )%> type="radio" name="selectRegion" value="<%=JspHelper.filterNull( zylstdareaMap.get("areaid") )%>" <%=JspHelper.filterNull( strIsChecked )%> class="normalradio">
      </td>
      <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( zylstdareaMap.get("areacode") )%></td>
      <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( zylstdareaMap.get("areaname") )%></td>
    </tr>
    </logic:iterate> 
    <input type="hidden" name="areacode" value="<%=JspHelper.filterNull( strZylstdareaCode )%>">    
    <input type="hidden" name="areaname" value="<%=JspHelper.filterNull( strZylstdareaName )%>">
    <input type="hidden" name="areaid" value="<%=JspHelper.filterNull( nZylstdareaid )%>">
                    <% //--------------------------------------  flipping page --%>
    		<%@ include file="/inc/SummaryActionPop.inc" %>
        
      </table>
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="summary_top"></td>
          </tr>
          <tr> 
            
    <td class="td_center"><a onclick="setParentValue()"><custom:button type="1" label="L_Finish" imgsrc="finish.gif" border="0" style="width:60"/></a></td>
          </tr>
        </table>
      </td>
    </tr>
            </form>

</table>
</body>
</html>


